onmessage = function(event){
var url = event.data;
var res = getResponse(url);
postMessage(res);
}

function getResponse(url) {

var http = new XMLHttpRequest();

if (http) {
http.open("GET", url, false);
http.send(null);
if(http.readyState == 4 && http.status == 200) return http.responseText;
} else return false;

}